cmake_minimum_required (VERSION 3.20)

project(OCCTTutorial)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options("/utf-8")

# 3rdparty解压缩文件夹路径
set(M3RDPARTY_DIR E:/library)
message(${M3RDPARTY_DIR})

set(QTROOT_DIR C:/Qt/6.6.3)
message(${QTROOT_DIR})
# Qt
set(Qt6_DIR ${QTROOT_DIR}/msvc2019_64/lib/cmake/Qt6)
find_package(Qt6 COMPONENTS 
Core 
Gui 
Widgets 
OpenGL 
Xml
REQUIRED)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

# VTK
# set(VTK_DIR ${M3RDPARTY_DIR}/VTK/VTK-9.4.1/INSTALL/lib/cmake/vtk-9.4)
# find_package(VTK REQUIRED)

# occt
set(OpenCASCADE_DIR ${M3RDPARTY_DIR}/OCCT/OCCT-7.9.1/INSTALL/cmake)
find_package(OpenCASCADE
         REQUIRED)

#add_subdirectory(OCCTOverview)
#add_subdirectory(MView)
#add_subdirectory(MViewVTK)
add_subdirectory(OCCTQtDemo)
#add_subdirectory(OCCTCAM)

if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
file(GLOB_RECURSE DEBUG_DLLS 
"${QTROOT_DIR}/msvc2019_64/bin/Qt6Widgetsd.dll" 
"${QTROOT_DIR}/msvc2019_64/bin/Qt6Cored.dll" 
"${QTROOT_DIR}/msvc2019_64/bin/Qt6Guid.dll" 
"${QTROOT_DIR}/msvc2019_64/bin/Qt6Svgd.dll" 
"${QTROOT_DIR}/msvc2019_64/bin/Qt6Xmld.dll"
"${M3RDPARTY_DIR}/OCCT/OCCT-7.9.1/INSTALL/win64/vc14/bind/*.dll" 
"${M3RDPARTY_DIR}/OCCT/OCCT-7.9.1/3rdparty-vc14-64/freeimage-3.18.0-x64/bin/*.dll" 
"${M3RDPARTY_DIR}/OCCT/OCCT-7.9.1/3rdparty-vc14-64/freetype-2.13.3-x64/bin/*.dll" 
"${M3RDPARTY_DIR}/OCCT/OCCT-7.9.1/3rdparty-vc14-64/tcltk-8.6.15-x64/bin/*.dll" 

#"${M3RDPARTY_DIR}/VTK/VTK-9.4.1/INSTALL/bin/*d.dll" 
)
install(FILES ${DEBUG_DLLS} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/dlls)

elseif (${CMAKE_BUILD_TYPE} STREQUAL "Release")

endif()
